#include #include #include #include using namespace std; //i is passed to the function fun "by value" void fun(int i) { cout << i << endl; i = 9; cout << i << endl; } //i is passed to the function fun2 "by reference" void fun2(int& i) { cout << i << endl; i = 9; cout << i << endl; } void swap(int& x, int& y) { int temp = x; x = y; y = temp; } int random(int lowBound, int highBound) { return (rand() % (highBound - lowBound + 1) + lowBound); } void main() { //int y = 0; //int w = 77; //int& x = y; //x = w; //y = 3; //cout << x << endl; //fun2(y); //cout << y << endl; //int q = 9; //int p = 88; //swap(q,p); srand((unsigned int)time(NULL)); for(int i = 0; i < 100;i++) { cout << random(1,6) + random(1,6) << endl; } }